<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>

		<script>
			var num = prompt('请输入一个正整数');
			let str = num + '=';
			var c = getSu(num);
			var num1 = num;
			var d = true;

			function getNum(num) {
				if (num == 1) {
					return false;
				} else {
					for (var i = 2; i < num; i++) {
						if (num % i == 0) {
							return false;
						}
					}
					return true;
				}
			}

			function getSu(num) {
				var str2 = [];
				for (var i = 2; i < num; i++) {
					if (num % i == 0 && getNum(i)) {
						str2.push(i);
					}
				}
				return str2;
			}

			function getChu(num) {
				while (d) {
					for (var i = 0; i < c.length; i++) {
						if (num1 % c[i] == 0) {
							str += c[i] + '*';
							num1 /= c[i];
							break
						}
					}
					for (var j = 0; j < c.length; j++) {
						if (num1 == c[j]) {
							str += c[j];
							d = false;
							break
						}
					}
				}
				alert(str);
			}

			function dif2(num) {
				alert(num + '=' + '1' + '*' + num);
			}

			function result(num) {
				if (!getNum(num)) {
					getChu(num);
				} else {
					dif2(num);
				}
			}
			result(num);
		</script>
	</body>
</html>
